﻿//{ "data": "JournalNO" },
var admin = getCookie('jiangjin').split("&")[3].split("=")[1];
$(function () {
    var columns = [{
        "data": "OrderNo", render: function (value, type, row) {
            if (admin == "07332506fa00992798c91411c89023a8") {
                if (row.OrderNo == 0) {
                    return '<span class="text-danger">没有订单编号</span>'
                } else {
                    return '<a href="javascript:void(0)" onclick="FinancialDetails(&apos;' + row.OrderNo + '&apos;)">' + value + '</a>'
                }
            } else {
                if (row.OrderNo == 0) {
                    return '<span class="text-danger">没有订单编号</span>'
                } else {
					return '<a href="javascript:void(0)" onclick="OrderPro(&apos;' + row.OrderNo + '&apos;)">' + value + '</a>'
                }
            }
        }
    }, { "data": "Type" }, { "data": "In" }, { "data": "Out" }, { "data": "Rest" }, { "data": "Title" }, { "data": "Remarks" }, { "data": "Operator" }, { "data": "AddDT" }]
    //{ "data": "OrderMoney" },{ "data": "Out" }, { "data": "Name" },
    dataTable.dataTables("/Finance/PartialFinance", columns, false)
    $("#dataTable_wrapper .row:last-child").addClass("mt-2");
    $("#exampleAccordion>li:nth-child(2)").addClass("active");
})

function FinancialDetails(id) {
    layer.open({
        type: 2,
        title: '财务详情',
        shadeClose: true,
        shade: 0.8,
        area: ['80%', '83%'],
        content: '/Finance/FinancialDetails/?id=' + id //iframe的url
    });
}
//详情
function OrderPro(id) {
	layer.open({
		type: 2,
		title: '订单详情',
		shadeClose: true,
		shade: 0.8,
		area: ['40%', '50%'],
		content: '/Order/OrderPro/?id=' + id //iframe的url
	});
}